#!/bin/bash
# Copyright 2019-2022 Alibaba Group Holding Limited.
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

source $(dirname "$0")/libs/working_dir
source libs/catch_error

podman cp $1/patch.diff plugsched:/root/patch
podman exec plugsched patch -f -p1 -i patch
podman exec plugsched plugsched-cli build scheduler
podman exec plugsched patch -f -p1 -i patch -R
podman exec plugsched ls /root/scheduler/working/rpmbuild/RPMS/$(uname -i)/
podman exec plugsched bash -c "cp /root/scheduler/working/rpmbuild/RPMS/$(uname -i)/scheduler-xxx-*.rpm /root"

